home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Atari Compendium
/
The Atari Compendium (Toad Computers) (1994).iso
/
files
/
umich
/
network
/
news
/
bsnews.arc
/
GETHOST.C
next >
Wrap
C/C++ Source or Header
|
1989-08-23
|
743b
|
36 lines
/*
* gethost.c - get the name of the feeder site for bootstrap news
* copyright 1989 Ronald Florence (ron@mlfarm 7/9/89)
*
* The original package got the host name from a compile-time constat.
* Since many people may not want to re-compile this, we get the name
* from a file.
* by David Beckemeyer (david@bdt 8/23/89)
*
*/
#include <stdio.h>
#define SYSFILE "\\usr\\lib\\news\\sys"
char *feedhost()
{
FILE *fp;
static char host[32];
char *p;
if ((fp = fopen(SYSFILE, "r")) == 0) {
printf("cannot open %s\n", SYSFILE);
exit(1);
}
if (!fgets(host, 32, fp)) {
printf("cannot read %s\n", SYSFILE);
exit(1);
}
fclose(fp);
for (p = host; *p > ' '; p++)
;
*p = 0;
return(host);
}